home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
atari
/
m2
/
cat3src
/
cat
/
catgloba.i
< prev
next >
Wrap
Text File
|
1997-10-26
|
25KB
|
840 lines
IMPLEMENTATION MODULE CatGlobal;
FROM SYSTEM IMPORT ADDRESS, ADR, CODE, CALLSYS, CADR, LOC;
IMPORT FileNames, Strings, Storage;
IMPORT mtAppl;
IMPORT MagicTypes;
IMPORT MagicAES;
IMPORT MagicCookie;
IMPORT mtUtils;
IMPORT MausTauschrsc;
IMPORT CatTypes;
IMPORT ConfVars;
IMPORT Varnames;
IMPORT Mintbind;
IMPORT FileSys;
FROM Void IMPORT v;
FROM GrafBase IMPORT Rectangle;
IMPORT MagicStrings, mtDir, MagicDOS, mtCommand, MagicSys;
CONST
(* Cookies definieren *)
FselCookie = 'FSEL';
MagiXCookie = 'MagX';
MultiGEMCookie = 'MGEM';
MagicMacCookie = 'MgMc';
VAR update : BOOLEAN;
applPath : CatTypes.pathStrType;
applName : CatTypes.nameStrType;
apName : ARRAY [0..39] OF CHAR;
PROCEDURE UpdateWindow(doUpdate : BOOLEAN);
(* Sorgt fr die Update-Window Aufrufe. Es ist immer nur garantiert ein
* WindUpdate aktiv, keine geschachtelten mehr!
*)
BEGIN
IF doUpdate # update
THEN
IF doUpdate
THEN
MagicAES.WindUpdate (MagicAES.BEGUPDATE)
ELSE
MagicAES.WindUpdate (MagicAES.ENDUPDATE);
END;
update := doUpdate
END;
END UpdateWindow;
PROCEDURE SetColors();
(* Setzt die Farbvariablen auf die in den Configvariablen
* eingestellten Werte
*)
BEGIN
(* Anzeige *)
ConfVars.GetConfDefInt (cGrinTextCol, viewTextCol, 1);
ConfVars.GetConfDefInt (cGrinQuoteCol, viewQuoteCol, 1);
ConfVars.GetConfDefInt (cGrinQuoteEff, viewQuoteEff, 1);
ConfVars.GetConfDefInt (cGrinBackCol, viewBackCol, 0);
(* Editor *)
ConfVars.GetConfDefInt (cEditTextCol, editTextCol, 1);
ConfVars.GetConfDefInt (cEditBackCol, editBackCol, 0);
(* Stichwortliste *)
ConfVars.GetConfDefInt (cListTextCol, listTextCol, 1);
ConfVars.GetConfDefInt (cListQuoteCol, listUnreadCol, 1);
ConfVars.GetConfDefInt (cListBackCol, listBackCol, 0);
ConfVars.GetConfDefInt (cListOwnCol, listOwnCol, 1);
ConfVars.GetConfDefInt (cListQuoteEff, listUnreadEff, 1);
ConfVars.GetConfDefInt (cListOwnEff, listOwnEff, 1);
(* Nachrichtenauswahl *)
ConfVars.GetConfDefInt (cMsgTextCol, msgTextCol, 1);
ConfVars.GetConfDefInt (cMsgBackCol, msgBackCol, 0);
ConfVars.GetConfDefInt (cMsgHoldCol, msgHoldCol, 1);
ConfVars.GetConfDefInt (cMsgHoldEff, msgHoldEff, 1);
(* Bume *)
ConfVars.GetConfDefInt (cTreeTextCol, treeTextCol, 1);
ConfVars.GetConfDefInt (cTreeBackCol, treeBackCol, 0);
ConfVars.GetConfDefInt (cTreeSubjectCol, treeLineCol, 1);
ConfVars.GetConfDefInt (cTreeUnreadCol, treeUnreadCol, 1);
ConfVars.GetConfDefInt (cTreeUnreadEff, treeUnreadEff, 1);
(* Naja, keine Farbe ;-) *)
ConfVars.GetConfDefStr (cOwnName, userName, "");
END SetColors;
PROCEDURE FselGet(VAR InPath, InSel: ARRAY OF CHAR; REF ext, msg : ARRAY OF CHAR;
pathOnly : BOOLEAN):BOOLEAN;
(* Ausgelagert aus CAT.M, da ich die auch im Editor verwenden kann.
*)
TYPE fselPtr = POINTER TO RECORD
id : LONGCARD;
version : CARDINAL;
END;
VAR scrapP : CatTypes.pathStrType;
scrapN : CatTypes.nameStrType;
l : CARDINAL;
fsel : fselPtr;
noMCtrl: BOOLEAN;
BEGIN
mtDir.DelTail (InPath);
MagicStrings.Assign(InPath, scrapP);
(*
l := LENGTH (InPath);
IF l > 0
THEN
IF InPath[l-1] #'\'
THEN InPath[l-1] := '\';InPath[l] := 0C;
END;
END;
*)
noMCtrl := MagicCookie.FindCookie (FselCookie, fsel);
IF noMCtrl
THEN
noMCtrl := fsel^.version >= 0200H;
END;
MagicStrings.Assign(InSel, scrapN);
MagicStrings.Append(ext, InPath);
IF ~noMCtrl
THEN
MagicAES.WindUpdate(MagicAES.BEGMCTRL);
END;
IF mtDir.GetDir(InPath, InSel, msg) THEN
IF ~noMCtrl
THEN
MagicAES.WindUpdate(MagicAES.ENDMCTRL);
END;
mtDir.DelTail(InPath);
IF pathOnly
THEN
RETURN TRUE
ELSE
IF LENGTH (InSel) = 0
THEN
MagicStrings.Assign(scrapP, InPath);
MagicStrings.Assign(scrapN, InSel);
RETURN FALSE;
END;
RETURN TRUE;
END;
ELSE
IF ~noMCtrl
THEN
MagicAES.WindUpdate(MagicAES.ENDMCTRL);
END;
MagicStrings.Assign(scrapP, InPath);
MagicStrings.Assign(scrapN, InSel);
RETURN FALSE
END
END FselGet;
PROCEDURE WithShift (kstate : BITSET) : BOOLEAN;
(* Gibt zurck, ob eine der Shifttasten gedrckt wurde *)
BEGIN
RETURN (MagicAES.KLSHIFT IN kstate) OR (MagicAES.KRSHIFT IN kstate)
END WithShift;
PROCEDURE WithCtrl (kstate : BITSET) : BOOLEAN;
(* Gibt zurck, ob Ctrl gedrckt wurde *)
BEGIN
RETURN (MagicAES.KCTRL IN kstate)
END WithCtrl;
PROCEDURE WithAlt (kstate : BITSET) : BOOLEAN;
(* Gibt zurck, ob Alternate gedrckt wurde *)
BEGIN
RETURN (MagicAES.KALT IN kstate)
END WithAlt;
(*$L-,S-,R-*)
PROCEDURE mouseData1;
BEGIN
CODE (7,7,1,0,1,
(* mask data *)
960,4080,8184,16380,32766,32766,65535,65535,
65535,65535,32766,32766,16380,8184,4080,960,
(* mouse data *)
0,960,3888,7944,16132,16132,32514,32514,
16638,16638,8444,8444,4344,3312,960,0
);
END mouseData1;
PROCEDURE mouseData2;
BEGIN
CODE (
7,7,
1,0,1,
(* mask data *)
960,4080,8184,16380,32766,32766,65535,65535,
65535,65535,32766,32766,16380,8184,4080,960,
(* mouse data *)
0,960,4080,8184,12276,10212,17346,16770,
16770,17346,10212,12276,8184,4080,960,0
);
END mouseData2;
PROCEDURE mouseData3;
BEGIN
CODE (
7,7,
1,0,1,
(* mask data *)
960,4080,8184,16380,32766,32766,65535,65535,
65535,65535,32766,32766,16380,8184,4080,960,
(* mouse data *)
0,960,3312,4344,8444,8444,16638,16638,
32514,32514,16132,16132,7944,3888,960,0
);
END mouseData3;
PROCEDURE mouseData4;
BEGIN
CODE (
7,7,
1,0,1,
(* mask data *)
960,4080,8184,16380,32766,32766,65535,65535,
65535,65535,32766,32766,16380,8184,4080,960,
(* mouse data *)
0,960,3120,4104,14364,15420,32382,32766,
32766,32382,15420,14364,4104,3120,960,0
);
END mouseData4;
(*$L=,R=*)
CONST mouseForms = 4;
VAR mouseArray : ARRAY [0..mouseForms] OF POINTER TO MagicTypes.MFORM;
mf : MagicTypes.MFORM;
mouseIndex : CARDINAL;
PROCEDURE busyMouse();
BEGIN
mf := mouseArray[mouseIndex]^;
mtAppl.UserMouse (mf);
mtAppl.MouseUser;
mouseIndex := (mouseIndex + 1) MOD mouseForms;
END busyMouse;
PROCEDURE FullScreenRedraw();
(* Nur fr nicht-MultiTOS geeignet *)
VAR rec : RECORD x,y,w,h : INTEGER END;
BEGIN
WITH rec DO
x := 0; y := 0; w := mtAppl.MaxWidth; h := mtAppl.MaxHeight;
END;
MagicAES.FormDial(MagicAES.FMDFINISH, rec, rec);
v.int := MagicAES.MenuBar(MausTauschrsc.TreeAddr^[MausTauschrsc.menu], MagicAES.Set);
END FullScreenRedraw;
PROCEDURE ConvertTabs (REF source : ARRAY OF CHAR; VAR dest : ARRAY OF CHAR; tabSize : CARDINAL);
CONST TAB = 11C;
VAR i, j, k, high : CARDINAL;
BEGIN
IF HIGH (source) < HIGH (dest)
THEN
high := HIGH (source)
ELSE
high := HIGH(dest);
END;
i := 0;
j := 0;
WHILE (source[i] # 0C) & (i < high) & (j < high) DO
IF source[i] = TAB
THEN
FOR k := j TO (((j DIV tabSize)+1)*tabSize)-1 DO
dest[k] := ' ';
END;
j := ((j DIV tabSize) + 1) * tabSize;
ELSE
dest[j] := source[i];
INC(j);
END;
INC(i);
END;
dest[j] := 0C;
END ConvertTabs;
PROCEDURE ReplaceStr (VAR str : ARRAY OF CHAR; REF s1, s2 : ARRAY OF CHAR);
VAR p : CARDINAL;
sLen : CARDINAL;
s1Len: CARDINAL;
BEGIN
sLen := LENGTH (str);
s1Len:= LENGTH (s1);
p := MagicStrings.Pos (s1, str, 0, FALSE);
WHILE p <= sLen DO
MagicStrings.Delete (str, p, s1Len);
MagicStrings.Insert (s2, str, p);
sLen := LENGTH (str);
p := MagicStrings.Pos (s1, str, p, FALSE);
END;
END ReplaceStr;
PROCEDURE MakeStr(VAR source, dest : ARRAY OF CHAR);
VAR z, l : CARDINAL;
cut : ARRAY[0..5] OF CHAR;
ap : ARRAY[0..1] OF CHAR;
BEGIN
l := MagicStrings.Length(dest);
MagicStrings.Copy(dest, l-3, 3, cut);
MagicStrings.Assign (' ',dest);
MagicStrings.Append(source, dest);
z := MagicStrings.Length(dest);
MagicStrings.Assign (' ', ap);
WHILE z <= l-4 DO
MagicStrings.Append(ap, dest);
INC(z)
END;
MagicStrings.Append(cut, dest);
END MakeStr;
(* Save Funktion *)
PROCEDURE CreateBackup (REF fname : ARRAY OF CHAR): BOOLEAN;
VAR newName, path, name : ARRAY [0..139] OF CHAR;
ext : ARRAY[0..7] OF CHAR;
res : INTEGER;
oldDTA : MagicDOS.PtrDTA;
myDTA : MagicDOS.DTA;
dHandle : LONGINT;
BEGIN
FileNames.SplitPath (fname, path, name);
FileNames.SplitName (name, name, ext);
IF MagicStrings.Equal (ext,'BAK')
THEN
MagicStrings.Assign ('BAZ',ext);
ELSE
MagicStrings.Assign ('BAK',ext);
END;
(* neuen Namen zusammensetzen *)
FileNames.ConcatName (name, ext, name);
FileNames.ConcatPath (path, name, newName);
IF ~isMintDomain
THEN
(* Feststellen, ob Datei schon existiert *)
oldDTA := MagicDOS.Fgetdta ();
MagicDOS.Fsetdta (ADR(myDTA));
res := MagicDOS.Fsfirst (newName, {0,1,2,4,5});
MagicDOS.Fsetdta (oldDTA);
IF res = 0
THEN
(* Wenn Directory, dann Abbruch *)
IF myDTA.dAttrib = $10
THEN
RETURN FALSE
END;
(* kein Directory, also alte Datei lschen *)
IF ~MagicDOS.Fdelete (newName) THEN RETURN FALSE END;
END;
ELSE
(* Feststellen, ob Datei schon existiert *)
res := MagicDOS.Fopen (newName, MagicDOS.Read);
IF res >= 0
THEN
(* Datei existiert *)
v.int := MagicDOS.Fclose (res);
(* kein Directory, also alte Datei lschen *)
IF ~MagicDOS.Fdelete (newName) THEN RETURN FALSE END;
ELSE
(* Kann nicht geffnet werden, mglicherweise Directory? *)
dHandle := Mintbind.Dopendir (newName, 0);
IF dHandle >= 0
THEN
(* ist Directory, abbrechen *)
v.lint := Mintbind.Dclosedir (dHandle);
RETURN FALSE;
END;
END;
END;
res := MagicDOS.Frename (fname, newName);
RETURN res = 0;
END CreateBackup;
(*-----------------------------------------------------------------------
*
* Pathfree ersetzt MagicDOS.Dfree
*
* Durch PathFree wird kontrolliert, wieviel Speicherplatz in einem
* bestimmten Pfad frei ist. Dabei werden gelinkte Pfade korrekt
* aufgelst.
*
*-----------------------------------------------------------------------*)
PROCEDURE PathFree(VAR dib : ARRAY OF LOC; VAR Path : ARRAY OF CHAR);
PROCEDURE GetDrv(VAR Path : ARRAY OF CHAR) : CHAR;
TYPE
tpStr = POINTER TO ARRAY[0..511] OF CHAR;
VAR
count : CARDINAL;
pPath, pLink : tpStr;
drv : CHAR;
BEGIN
count := LENGTH(Path);
WHILE count > 0 DO
Storage.ALLOCATE(pPath, count+1);
Storage.ALLOCATE(pLink, 512);
MagicStrings.Copy(Path, 0, count, pPath^);
IF Mintbind.Freadlink(pLink^, pPath^) >= 0
THEN
(* dies ist ein Link, dessen Pfad wird weiter verfolgt
*)
drv := GetDrv(pLink^);
Storage.DEALLOCATE(pPath, 0);
Storage.DEALLOCATE(pLink, 0);
RETURN drv;
END;
Storage.DEALLOCATE(pPath, 0);
Storage.DEALLOCATE(pLink, 0);
(* nchstes Pfadelement abtrennen *)
REPEAT
DEC(count);
UNTIL (count = 0) OR (Path[count] = '\');
END;
RETURN CAP(Path[0]);
END GetDrv;
BEGIN
MagicDOS.Dfree(dib, ORD(GetDrv(Path)) - ORD('A') + 1);
END PathFree;
(*$L-,R-,S-*)
PROCEDURE Bong1();
BEGIN
CODE (
$0810, (* VolA := $10 *)
$0918, (* VolB := $18 *)
$0a00, (* VolC := $00 *)
$0b00, (* EnvPer := $2000 *)
$0c20,
$0d09, (* EnvForm *)
$07f8,
$0088, (* PerA := $0e8 *)
$0100,
$0220, (* PerB := $220 *)
$0302,
$8228, (* 0.8 second delay *)
$0800, (* VolA := 0 *)
$0900, (* VolB := 0 *)
$8200 ) ;
END Bong1;
(* Die nachfolgenden Klnge sind genauso aufgebaut: *)
PROCEDURE Bong2();
BEGIN
CODE (
$0810, $0918, $0a00, $0b00, $0c20, $0d09,
$07f8, $00e8, $0101, $0220, $0302, $8228,
$0800, $0900, $8200 ) ;
END Bong2;
PROCEDURE Bong3();
BEGIN
CODE (
$0810, $0918, $0a00, $0b00, $0c20, $0d09,
$07f8, $00e8, $0103, $0220, $0301, $8228,
$0800, $0900, $8200 ) ;
END Bong3;
PROCEDURE Bong4();
BEGIN
CODE (
$0810, $0918, $0a00, $0b00, $0c20, $0d09,
$07f8, $0068, $0100, $02f0, $0300, $8228,
$0800, $0900, $8200 ) ;
END Bong4;
PROCEDURE Bong5();
BEGIN
CODE (
$0810, $0918, $0a00, $0b00, $0c20, $0d09,
$07f8, $0028, $0100, $0280, $0300, $8228,
$0800, $0900, $8200 ) ;
END Bong5;
PROCEDURE Bong6();
BEGIN
CODE (
$0810, $0918, $0a00, $0b00, $0c20, $0d09,
$07f8, $0028, $0104, $0280, $0306, $8228,
$0800, $0900, $8200 ) ;
END Bong6;
PROCEDURE Bong7();
BEGIN
CODE ($0101,$005e,$80f0,$07fe,$ff00)
END Bong7;
PROCEDURE Bong72();
BEGIN
CODE ($0101,$005E,$081F,$0300,$0200,$0900,$0500,$0400,
$0A00,$0600,$07FE,$0D01,$0C3C,$0BAF,$FF00)
END Bong72;
(*$L=,R=*)
CONST maxBing = 7;
VAR bongArray : ARRAY [1..maxBing] OF ADDRESS;
PROCEDURE Bing(which : INTEGER);
BEGIN
IF (which <= 0) OR (which > maxBing) OR (magicMac)
THEN
MagicDOS.Cconout (7C);
ELSE
(* Dosound von der MagicLib will ein ARRAY OF LOC, deshalb so *)
CALLSYS (14, 32, bongArray[which]);
IF which = 7 THEN
CALLSYS (14, 32, ADDRESS(Bong72));
END;
END
END Bing;
PROCEDURE SetStrings (tree: ADDRESS; from, to : INTEGER; REF string : ARRAY OF CHAR);
VAR i : INTEGER;
entryLen : INTEGER;
obIdx : INTEGER;
str : ARRAY [0..79] OF CHAR;
BEGIN
(* Alle Textfelder lschen *)
FOR i := from TO to DO
mtUtils.SetObjcString (tree, i, '');
END;
i := 0;
obIdx := from;
WHILE (i < INTEGER(LENGTH (string))) & (obIdx <= to) DO
mtUtils.ObjcStrLen (tree, obIdx, entryLen, v.int);
DEC (entryLen, 4);
MagicStrings.Copy (string, i, entryLen-1, str);
mtUtils.SetObjcString (tree, obIdx, str);
INC (obIdx);
INC (i, entryLen-1);
END;
END SetStrings;
PROCEDURE GetStrings (tree: ADDRESS; from, to: INTEGER; VAR string : ARRAY OF CHAR);
VAR i : INTEGER;
str : ARRAY [0..79] OF CHAR;
BEGIN
string[0] := '';
FOR i := from TO to DO
mtUtils.ObjcString (tree, i, str);
MagicStrings.Append (str, string);
END;
END GetStrings;
PROCEDURE SetAppl (REF str: ARRAY OF CHAR);
(* Setzt den Namen der Applikation fr interne Zwecke
* Der Name mu ohne Extension angegeben werden.
*)
BEGIN
MagicStrings.Assign (str, apName);
IF apName[LENGTH(apName)-1] # '.'
THEN
MagicStrings.Append ('.', apName);
END;
END SetAppl;
PROCEDURE GetApplPath (VAR path: ARRAY OF CHAR);
(* liefert den Pfad der Applikation, initialisiert dabei die interne
* Variable. Vorher mu einmal SetAppl aufgerufen werden
*)
VAR p: ARRAY [0..255] OF CHAR;
d: CARDINAL;
drv : CARDINAL;
dummy: MagicSys.lBITSET;
l : CARDINAL;
BEGIN
IF mtCommand.ArgV()
THEN
mtCommand.ParamString (0, p);
ELSE
(* Erstmal ShelRead aufrufen *)
MagicAES.ShelRead (p, applPath);
END;
FileNames.SplitPath (p, applPath, applName);
(* Jetzt testen, ob applName in Ordnung ist.
*)
IF MagicStrings.Pos (apName, applName, 0, FALSE) > 0
THEN
(* Stimmt wohl nicht! Dann stimmt gar nichts, Pfad und
* Laufwerk rausfinden und dann mit ShelFind nach apName
* mit verschiedenen Extensions suchen
*)
MagicStrings.Assign (apName, p);
MagicStrings.Append ('PRG', p);
MagicAES.ShelFind (p);
IF MagicAES.CallResult = 0
THEN
MagicStrings.Assign (apName, p);
MagicStrings.Append ('APP', p);
MagicAES.ShelFind (p);
IF MagicAES.CallResult = 0
THEN
(* Zweimal nicht gefunden. Jetzt sehen wir alt aus!
* Wir holen dann den applPath als aktuellen Pfad
*)
MagicAES.CallResult := 1;
MagicStrings.Assign ('', p);
END;
END;
IF MagicAES.CallResult # 0
THEN
FileNames.SplitPath (p, applPath, applName);
IF LENGTH (applPath) = 0
THEN
d := MagicDOS.Dgetdrv ();
MagicDOS.Dgetpath (applPath, d+1);
IF applPath[1] # ':'
THEN
IF applPath[0] # '\'
THEN
MagicStrings.Insert ('A:\', applPath, 0);
ELSE
MagicStrings.Insert ('A:', applPath, 0);
END;
applPath[0] := CHR(ORD('A') + d);
END;
END;
END;
END;
(* Jetzt testen wir den Pfad, ob der vollstndig ist *)
d := MagicDOS.Dgetdrv ();
MagicDOS.Dgetpath (p, d+1);
l := LENGTH (p);
IF (l = 0) OR ((l > 0) & (p[l-1] # '\'))
THEN
MagicStrings.Append ('\', p);
END;
IF applPath[0] = '\'
THEN
(* Laufwerksbezeichner fehlt *)
MagicStrings.Insert ('A:', applPath, 0);
applPath[0] := CHR(ORD('A') + d);
ELSIF applPath[1] # ':'
THEN
(* Ist wohl ein relativer Pfad, also Laufwerk und Pfad einsetzen
*)
MagicStrings.Insert (p, applPath, 0);
MagicStrings.Insert ('A:', applPath, 0);
applPath[0] := CHR(ORD('A') + d);
ELSIF applPath[2] # '\'
THEN
(* Relativer Pfad mit Laufwerksangabe *)
drv:= ORD (applPath[0]) - 65;
MagicDOS.Dsetdrv (drv, dummy);
MagicDOS.Dgetpath (p, 0);
MagicDOS.Dsetdrv (d, dummy);
l := LENGTH (p);
IF (l = 0) OR ((l > 0) & (p[l-1] # '\'))
THEN
MagicStrings.Append ('\', p);
END;
MagicStrings.Insert (p, applPath, 2);
END;
l := LENGTH (applPath);
IF (l > 2) & (applPath [l-1] # '\')
THEN
MagicStrings.Append ('\', applPath);
END;
MagicStrings.Assign (applPath, path);
END GetApplPath;
PROCEDURE ApplPath (VAR path: ARRAY OF CHAR);
(* liefert den Pfad der Applikation
*)
BEGIN
MagicStrings.Assign (applPath, path);
END ApplPath;
PROCEDURE ApplName (VAR name: ARRAY OF CHAR);
(* liefert den Namen der Applikation
*)
BEGIN
MagicStrings.Assign (applName, name);
END ApplName;
PROCEDURE Konjugiere (REF str1, single, plural: ARRAY OF CHAR;
count: CARDINAL; VAR out: ARRAY OF CHAR);
(* konjugiert ein Wort nach Singular oder Plural
*)
BEGIN
MagicStrings.Assign (str1, out);
IF count = 1
THEN
MagicStrings.Append (single, out);
ELSE
MagicStrings.Append (plural, out);
END;
END Konjugiere;
PROCEDURE KurzName (REF name: ARRAY OF CHAR; VAR ziel: ARRAY OF CHAR; maxLen: CARDINAL);
VAR p, n : INTEGER;
i : CARDINAL;
tmpStr : CatTypes.String255;
BEGIN
MagicStrings.Assign (name, tmpStr);
IF LENGTH (tmpStr) > maxLen
THEN
(* Erstmal Vornamen abkrzen *)
p := 0;
p := Strings.Pos (' ', tmpStr, 0);
IF p > 0
THEN
n := Strings.Pos ('@', tmpStr, 0);
IF (n-2 < p) & (n > 0)
THEN
(* Hinter dem @ abschneiden, da kein richtiger Vorname *)
tmpStr [n] := 0C;
ELSE
(* Vornamen verkrzen *)
Strings.Delete (tmpStr, 1, p-1, v.bool);
Strings.Insert ('.', 1, tmpStr, v.bool);
END;
END;
END;
IF LENGTH (tmpStr) > maxLen
THEN
(* Immer noch zu lang, hinten ... anhngen *)
FOR i := 1 TO 3 DO
tmpStr[maxLen-i] := '.';
END;
tmpStr[maxLen] := 0C;
END;
MagicStrings.Assign (tmpStr, ziel);
END KurzName;
TYPE magAESVARS = RECORD
magic : LONGCARD; (* mu $87654321 sein *)
membot : ADDRESS; (* Ende der AES- Variablen *)
aes_start : ADDRESS; (* Startadresse *)
magic2 : LONGCARD; (* ist 'MAGX' *)
date : LONGCARD; (* Erstelldatum *)
chgres : ADDRESS; (* void ( *chgres)(int res, int txt); /* Auflsung ndern *)
shel_vector: ADDRESS; (* long ( **shel_vector)(void); /* residentes Desktop *)
aes_bootdrv: ADDRESS; (* char *aes_bootdrv; /* von hieraus wurde gebootet *)
vdi_device : ADDRESS; (* int *vdi_device; /* vom AES benutzter Treiber *)
(* zustzliche Variablen, die nicht dokumentiert sind *)
nvdi_work : ADDRESS; (* void **nvdi_workstation; /* vom AES benutzte Workstation *)
shelw_doex : ADDRESS; (* int *shelw_doex; /* shel-write variable *)
shelw_isgr : ADDRESS; (* int *shelw_isgr; /* shel-write variable *)
version : INTEGER; (* int version; /* in Hex 0111 (BCD) *)
release : INTEGER; (* int release; /* +224 = Zeichen der Version *)
_basepage : LONGCARD;
moff_cnt : ADDRESS; (* int *moff_cnt; *)
shel_buf_len: LONGCARD; (* long shel_buf_len; *)
shel_buf : ADDRESS; (* long shel_buf; *)
ntrdy_list : LONGCARD; (* long notready_list; *)
menu_up : LONGCARD; (* long menu_up; *)
menutree : LONGCARD; (* long menutree; *)
desktree : LONGCARD; (* long desktree; *)
desk_1stob : LONGCARD; (* long desktree_1stob; *)
dos_magic : LONGCARD; (* long dos_magic; *)
max_windn : LONGCARD; (* long maxwindn; *)
fsel : ADDRESS; (* int ( **fsel) (char* path, char* name, int* button, char* title); *)
dummy : LONGCARD; (* long dummy; *)
END;
AESVARPTR = POINTER TO magAESVARS;
magXCookiePtr = POINTER TO RECORD
config_status : LONGCARD; (* long config_status; *)
dosvars : ADDRESS; (* DOSVARS *dosvars; *)
aesvars : AESVARPTR; (* AESVARS *aesvars; *)
END;
VAR magX_ptr : magXCookiePtr;
mg3dMode : INTEGER;
BEGIN (* Init-Teil vom Modul *)
SaveName := '';
OpenName := '';
prgName := '';
mouseIndex := 0;
mouseArray[0]:= ADDRESS (mouseData1);
mouseArray[1]:= ADDRESS (mouseData2);
mouseArray[2]:= ADDRESS (mouseData3);
mouseArray[3]:= ADDRESS (mouseData4);
mouseArray[4]:= mouseArray[0];
bongArray[1] := ADDRESS (Bong1);
bongArray[2] := ADDRESS (Bong2);
bongArray[3] := ADDRESS (Bong3);
bongArray[4] := ADDRESS (Bong4);
bongArray[5] := ADDRESS (Bong5);
bongArray[6] := ADDRESS (Bong6);
bongArray[7] := ADDRESS (Bong7);
(* Jetzt noch die TOS-Versionsvariablen initialisieren *)
(* Mindestens TOS 1.4 vorhanden? *)
minTos14 := MagicAES.AESGlobal.apVersion >= 0140H;
(* allgemein MultiTasking mglich? *)
multiTask := MagicAES.AESGlobal.apCount # 1;
(* Cookie abfragen, ob Mag!X *)
magIx := MagicCookie.FindCookie (MagiXCookie, magX_ptr);
IF magIx & (magX_ptr^.aesvars # NIL)
THEN
magIxVer := magX_ptr^.aesvars^.version;
magIxDate := ( (magX_ptr^.aesvars^.date MOD 65536L) * 65536L) +
(((magX_ptr^.aesvars^.date DIV 65536L) MOD 256L) * 256L) +
(magX_ptr^.aesvars^.date DIV (65536L*256L)) ;
CALLSYS (1, 4201, CADR ("magIxDate: %lx, mgxDate: %lx"), magIxDate, magX_ptr^.aesvars^.date);
END;
(* Eventuell sogar MultiTOS? *)
IF (MagicAES.AESGlobal.apVersion >= 0400H) & multiTask & ~magIx
THEN
(* MultiTOS *)
multiTOS := TRUE;
END;
(* Und jetzt noch abfragen, ob es vielleicht doch MultiGEM ist *)
multiGEM := ~multiTOS & ~magIx &
MagicCookie.FindCookie (MultiGEMCookie, v.lcard);
tos3DLook := multiTOS;
IF ~multiTOS & magIx
THEN
IF magIxVer > $200
THEN
(* ObjcSysvar, ob 3D-Look unter MagIx eingeschaltet ist *)
v.int := MagicAES.ObjcSysvar (0, 10, 0, 0, mg3dMode, v.int);
IF v.int > 0
THEN
tos3DLook := mg3dMode # 0;
END;
END;
END;
magicMac := magIx & MagicCookie.FindCookie (MagicMacCookie, v.lcard);
update := FALSE;
END CatGlobal.